package exam.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @author Xiongx
 * @version 1.0
 * @date 2021/4/3 19:37
 * @since JDK 1.8
 */
@Component
@Slf4j
public class MyEventListener implements ApplicationListener<MyEvent> {


    @Override
    public void onApplicationEvent(MyEvent myEvent) {
        Object data=myEvent.getSource();
        Object msgName=myEvent.getData();
        log.info(data+" "+msgName+"事件我监听到了");
    }
}
